let fruits = ["apple", "orange", "pear"];

alert(fruits.shift());

alert(fruits);

fruits.unshift("Apple");

alert(fruits);

let arr = [1, 2, 3, 4, 5];

arr.length = 2;

alert(arr);

arr.length = 5;
alert(arr[3]);


// 清空数组最简单的方法就是
arr.length = 0;